import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import {
  Button,
  Select,
  Option,
  Loading,
  Message,
  Icon,
  Tooltip,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Input,
  Form,
  FormItem,
  MessageBox,
  Popconfirm,
  Popover,
  Tag,
  Card,
  Tree,
  Upload,
  Tabs,
  TabPane,
  Table,
  TableColumn,
  Pagination,
  Dialog,
  Radio,
  RadioGroup,
  Transfer,
  Checkbox,
  CheckboxGroup,
  DatePicker,
  Divider,
  Empty
} from 'element-ui';
import VueClipboard from 'vue-clipboard2';
import apiConfig from 'lib/js/api.config';

Vue.prototype.$ELEMENT = { size: 'small', zIndex: 3000 }; // element ui 的全局配置
Vue.use(Button)
  .use(Select)
  .use(Option)
  .use(Icon)
  .use(Tooltip)
  .use(Dropdown)
  .use(DropdownMenu)
  .use(DropdownItem)
  .use(Input)
  .use(FormItem)
  .use(Popconfirm)
  .use(Popover)
  .use(Tag)
  .use(Card)
  .use(Tree)
  .use(Upload)
  .use(Tabs)
  .use(TabPane)
  .use(Table)
  .use(TableColumn)
  .use(Loading)
  .use(Pagination)
  .use(Dialog)
  .use(Form)
  .use(FormItem)
  .use(Radio)
  .use(RadioGroup)
  .use(Transfer)
  .use(VueClipboard)
  .use(Checkbox)
  .use(CheckboxGroup)
  .use(DatePicker)
  .use(Empty)
  .use(Divider);
Vue.prototype.$loading = Loading.service;
Vue.prototype.$msg = Message;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;

Vue.prototype.$myEnv = process.env.MY_ENV;
const isDev = process.env.NODE_ENV !== 'production';
Vue.prototype.$apiHost = isDev ? 'apiProxy' : apiConfig(process.env.MY_ENV);

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount('#app');
